package pro.cherish.knowledgedemovalid.vo;

import lombok.Data;

import javax.validation.constraints.AssertTrue;

@Data
public class TestVO {

    private String name;

    private Integer age;

    @AssertTrue
    public boolean isValid(){
        if(age<18){
            throw new RuntimeException("只允许成年人使用");
        }
        return true;
    }
}
